package com.caigou.modules.query.adpter

import android.widget.TextView
import com.caigou.comm.base.ext.prizeBallColor
import com.caigou.modules.query.R
import com.caigou.modules.query.bean.ColdHotItemBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author #Suyghur.
 * Created on 2021/12/19
 */
class ColdHotItemAdapter(dataset: MutableList<ColdHotItemBean>) :
    BaseQuickAdapter<ColdHotItemBean, BaseViewHolder>(R.layout.item_cold_hot_list, dataset) {
    override fun convert(holder: BaseViewHolder, item: ColdHotItemBean) {
        with(holder.getView<TextView>(R.id.item_cold_hot_tv_num)) {
            text = item.number
            setBackgroundResource(prizeBallColor(item.numberColor))
        }

        holder.setText(R.id.item_cold_hot_tv_count, item.count.toString())
    }
}